/*
 *
please input a string: 123 456
123 456
use get(), please input char: abs cc
abs cc
use get(a, 10)  input char: 01234567891
012345678

 */

#include <iostream>
using namespace std;
int main(void){
	char a[100] = {0};
	char c ;

	cout << "please input a string: ";
	//遇到空格就结束
	//cin >> a;  // 123  456 
	cin.getline(a, 100);
	cout << a << endl;

	cout << "use get(), please input char: ";
	while((c = cin.get()) != '\n')
		cout << c;
	cout << endl;

	cout << "use get(a, 10)  input char: ";
	cin.get(a, 10);
	cout << a <<endl;
	return 0;
}
